const p1 = new Promise((resolve, reject) => {
    setTimeout(() => {
        resolve("ok")
    }, 1000)
})

p1.then(res => {
    console.log(res)
}, reason => {
    console.log(reason)
})